<?php

class Kd_Data_Dcl_Insert extends Kd_Data_Dcl_Base {

    private $_values = array();
    private $_table = NULL;

    public function  __construct() {
        parent::__construct();
    }

    public function getTable(){
        return $this->_table;
    }

    public function getValues(){
        return $this->_values;
    }

    public function into($table){
        $this->_table = $table;
        return $this;
    }

    public function value($name, $value){
        $this->_values[$name] = $value;
        return $this;
    }

    public function toSql(){
        return Kd_Data_Factory::getInsertParser()->parse($this);
    }

    public function execute(){
        $sql = $this->toSql();
        return $this->getDbDriver()->setSql($sql, $this->getParameters())->execute();
    }
}